package com.example.jetpackstu.ui.news

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder
import com.example.jetpackstu.R
import com.example.jetpackstu.databinding.ItemNewsBinding
import com.example.jetpackstu.logic.entity.News


class NewsAdapter(list: MutableList<News>) :
    BaseQuickAdapter<News, BaseDataBindingHolder<ItemNewsBinding>>(R.layout.item_news, list) {

    init {
        addChildClickViewIds(R.id.btn_del, R.id.btn_edit)
    }

    override fun convert(holder: BaseDataBindingHolder<ItemNewsBinding>, item: News) {
        holder.dataBinding?.model = item
    }
}